<?php 
/**
* Categories
*/
class Categories extends CWidget
{
	public function init()
	{
		# code...
	}
	
	public function run()
	{
		$criteria = new CDbCriteria();
		$sort = new CSort('Category');
		$sort->defaultOrder=array(
			'create_time'=>CSort::SORT_DESC,
		);
		$sort->applyOrder($criteria);
		$categories = Category::model()->findAll($criteria);

		$this->render('categories', array(
			'categories'=>$categories,
		));
	}
}
?>